/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.giant.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author taticay
 */
@Entity
@Table(name = "in_class")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "InClass.findAll", query = "SELECT i FROM InClass i"),
    @NamedQuery(name = "InClass.findByIdClass", query = "SELECT i FROM InClass i WHERE i.inClassPK.idClass = :idClass"),
    @NamedQuery(name = "InClass.findByIdLine", query = "SELECT i FROM InClass i WHERE i.inClassPK.idLine = :idLine"),
    @NamedQuery(name = "InClass.findByIdBrand", query = "SELECT i FROM InClass i WHERE i.inClassPK.idBrand = :idBrand"),
    @NamedQuery(name = "InClass.findByCharacters", query = "SELECT i FROM InClass i WHERE i.characters = :characters"),
    @NamedQuery(name = "InClass.findByDescription", query = "SELECT i FROM InClass i WHERE i.description = :description"),
     @NamedQuery(name = "InClass.findByDescription2", query = "SELECT i FROM InClass i WHERE i.description2 = :description2"),
    @NamedQuery(name = "InClass.findByStatus", query = "SELECT i FROM InClass i WHERE i.status = :status")})
public class InClass implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected InClassPK inClassPK;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "characters")
    private String characters;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "description")
    private String description;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "description2")
    private String description2;
    @Basic(optional = false)
    @NotNull
    @Column(name = "status")
    private boolean status;

    public InClass() {
    }

    public InClass(InClassPK inClassPK) {
        this.inClassPK = inClassPK;
    }

    public InClass(InClassPK inClassPK, String characters, String description, String description2, boolean status) {
        this.inClassPK = inClassPK;
        this.characters = characters;
        this.description = description;
        this.description2 = description2;
        this.status = status;
    }

    public InClass(int idClass, int idLine, int idBrand) {
        this.inClassPK = new InClassPK(idClass, idLine, idBrand);
    }

    public InClassPK getInClassPK() {
        return inClassPK;
    }

    public void setInClassPK(InClassPK inClassPK) {
        this.inClassPK = inClassPK;
    }

    public String getCharacters() {
        return characters;
    }

    public void setCharacters(String characters) {
        this.characters = characters;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
    
    public String getDescription2() {
        return description2;
    }

    public void setDescription2(String description2) {
        this.description2 = description2;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (inClassPK != null ? inClassPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InClass)) {
            return false;
        }
        InClass other = (InClass) object;
        if ((this.inClassPK == null && other.inClassPK != null) || (this.inClassPK != null && !this.inClassPK.equals(other.inClassPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.giant.entities.InClass[ inClassPK=" + inClassPK + " ]";
    }
    
}
